# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Kessia 'even' Pinheiro <kessiapinheiro at gmail.com>

pkgname=sniffit
pkgver=0.5
pkgrel=3
pkgdesc="Very good packet sniffer for unix with ncurses interactive mode"
arch=('loong64' 'x86_64')
url="https://packages.ubuntu.com/source/sniffit"
#seems the website are out, ubuntu have all sources
#url=http://reptile.rug.ac.be/~coder/sniffit/sniffit.html"
license=('BSD')
depends=('ncurses' 'libpcap')
makedepends=('libtool')
source=("http://archive.ubuntu.com/ubuntu/pool/universe/s/${pkgname}/${pkgname}_${pkgver}.orig.tar.gz")
sha512sums=('cf6f4a1d396d47e0fa51cb527e8f64cc4f9af5f83121728ce6cbfb6a11509899e52a6c01f0dd20b0d3b92a567991390d9a616151c9496d4f2d764608ef3542bc')

build() {
  cd "${srcdir}/sniffit-sniffit-${pkgver}"
  test -x ./configure || ./autogen.sh
  ./configure --prefix=/usr --no-recursion --sbindir=/usr/bin
  make
}

package() {
  cd "${srcdir}/sniffit-sniffit-${pkgver}"

  make install DESTDIR="$pkgdir"

  install -dm0755 -g root -o root "$pkgdir"/usr/share/licenses/${pkgname}
  install -Dm0644 LICENSE "$pkgdir"/usr/share/licenses/${pkgname}

  install -dm0755 -g root -o root "$pkgdir"/usr/share/doc
  cp -r docs "$pkgdir"/usr/share/doc/sniffit
  cp -r examples "$pkgdir"/usr/share/doc/sniffit/examples
}
